<% form_for(@post, :url=>{:action=>'update'}) do |p| %>
  <%= p.error_messages %>
  <% if is_admin(session[:user_id]) && @post.parent_id.nil? %>
    <h1>Category</h1>
    <select name="post[category_id]" class="textInput">
      <% @categories.each do |c| %>
        <% if @post.category_id == c.id %>
          <option selected="selected" value="<%= c.id %>"><%= c.name %></option>
        <% else %>
          <option value="<%= c.id %>"><%= c.name %></option>
        <% end %>
      <% end %>
    </select>
  <% end %>
  <h1>Title</h1>
  <%= p.text_field :title, :class=>"textInput"  %>
  <br/>
  <h1>Post</h1>
  <%= p.text_area :body, :class=>"textInput"  %>
  <br/>
  <span class="new_post_submit"><%= p.submit "Submit", :class => "button" %></span>
<% end %>